package cn.xinfei.xdecision.common.dao.datax.datamanage.v2;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import cn.xinfei.xdecision.common.model.datax.datamanage.request.VariableBatchDeleteParam;
import cn.xinfei.xdecision.common.model.datax.datamanage.request.VariableDeleteParam;
import cn.xinfei.xdecision.common.model.datax.datamanage.request.VariableSaveAndUpdateParam;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import cn.xinfei.xdecision.common.model.datax.datamanage.v2.VariableScript;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface VariableScriptMapper extends BaseMapper<VariableScript> {

    String findScriptByVariableCode(@Param("varCode") String varCode);


    List<String>findScriptsByVariableCodes(@Param("varCodes") Collection<String> varCodes);


    @MapKey("varCode")
    Map<String, Map<String,String>> findVarCodeAndScriptByVarCodes(@Param("varCodes") Collection<String> varCodes);

    int updateVariableScript(@Param("varCode") String varCode,
                             @Param("organId") Long organId,
                             @Param("modifier") String modifier,
                             @Param("script") String script);

    int addVariableScriptList(@Param("varCodes") List<VariableSaveAndUpdateParam> variableList);

    void deleteVarScript(VariableDeleteParam variable);

    void batchDeleteVarScript(VariableBatchDeleteParam batchDeleteParam);

}
